package com.innovation.chengzhangriji.http;

import com.google.gson.annotations.SerializedName;
import com.innovation.library.http.InnovationRequestBody;

public class VideoUploadRequest extends BaseUploadRequest {

    public static final String PATH = BaseRequest.PATH + "api/post_vedio";

    private int length;

    private String text;

    private String videoUrl;

    private String pictureUrl;

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getVideoUrl() {
        return videoUrl;
    }

    public void setVideoUrl(String videoUrl) {
        this.videoUrl = videoUrl;
    }

    public String getPictureUrl() {
        return pictureUrl;
    }

    public void setPictureUrl(String pictureUrl) {
        this.pictureUrl = pictureUrl;
    }

    @Override
    protected InnovationRequestBody getInnovationRequestBody() {
        VideoUploadRequestBody body = new VideoUploadRequestBody();
        body.setPhone(getPhone());
        body.setToken(getToken());
        body.setUuid(getUuid());
        body.setBabyID(getBabyID());
        body.setLength(getLength());
        body.setText(getText());
        body.setVideoUrl(getVideoUrl());
        body.setPictureUrl(getPictureUrl());
        body.setLabel(getLabel());
        body.setLabelId(getLabelId());
        body.setCreateTS(getCreateTS());
        return body;
    }

    private class VideoUploadRequestBody extends BaseUploadRequestBody {

        @SerializedName("Duration")
        private int length;

        @SerializedName("Text")
        private String text;

        @SerializedName("Vedio")
        private String videoUrl;

        @SerializedName("Screenshot")
        private String pictureUrl;

        private VideoUploadRequestBody() {
            setSv(BaseRequestConfig.SV_VIDEO_UPLOAD);
        }

        public int getLength() {
            return length;
        }

        public void setLength(int length) {
            this.length = length;
        }

        public String getText() {
            return text;
        }

        public void setText(String text) {
            this.text = text;
        }

        public String getVideoUrl() {
            return videoUrl;
        }

        public void setVideoUrl(String videoUrl) {
            this.videoUrl = videoUrl;
        }

        public String getPictureUrl() {
            return pictureUrl;
        }

        public void setPictureUrl(String pictureUrl) {
            this.pictureUrl = pictureUrl;
        }
    }
}
